/*
 * test.scala
 */

package acorn.jash.commands

import acorn.jash.{Cmd,Path}

class test extends Cmd {
  override def exec {
    try {
      testPath
      out putln "Success"
    }
    catch {
      case e:Exception => out putln (e getMessage)
    }
  }

  def testPath {
    def test(p:String, p1:String) {
      val b = (Path winp p) == p1
      if (!b) throw new RuntimeException("wp \"" + p + "\" failed.")
    }
    test("abc", "abc")
    test("/abc", "\\abc")
    test("abc/", "abc\\")
    test("/", "\\")
    // test("yes", "sir")
    test("abc/efg", "abc\\efg")
    test("abc/efg/", "abc\\efg\\")
  }
}
